home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
FREENET
/
BRODIE
/
INTERNET
/
!InternetD
/
c
/
netwall
< prev
next >
Wrap
Text File
|
1995-05-16
|
998b
|
43 lines
#include "inetd.h"
#include "netwall.h"
#include "templates.h"
#include "oslib:osmodule.h"
static void netwall_exit(void)
{
xosmodule_free(sys()->data.netwall);
}
int netwall_init(void)
{
sys()->data.netwall = osmodule_alloc(sizeof(struct netwall));
if (sys()->data.netwall) {
atexit(netwall_exit);
sys()->data.netwall->want_foreground = 0;
}
return (sys()->data.netwall != NULL);
}
void netwall_udp(int s)
{
int length;
length = recv(s, sys()->data.netwall->buffer, NETWALLSIZE, 0);
if (length > 0) {
if (length >= NETWALLSIZE) length = NETWALLSIZE-1;
sys()->data.netwall->buffer[length] = '\0';
sys()->data.netwall->want_foreground = 1;
++(sys()->wimp_poll_word);
}
}
void netwall_fg_data(inet_handler *ih)
{
UNUSED(ih);
if (sys()->data.netwall->want_foreground) {
sys()->data.netwall->want_foreground = 0;
template_get_error_box(sys()->data.netwall->buffer);
}
}